#pragma once
#include<iostream>
#include<pthread.h>

using namespace std;

class Mutex
{
public: 
    Mutex(pthread_mutex_t* _mutex)
    :_mutex(mutex)
    {
        
    }
    void lock(){
        pthread_mutex_lock(_mutex);
    }
    void unlock(){
        pthread_mutex_unlock(_mutex);
    }
    ~Mutex(){

    }
private:
    pthread_mute_t* _mutex;
};

class LockGuard
{
public:
    LockGuard(pthread_mutex_t* mutex){
        _mtx.lock();
    }
    ~LockGuard(){
        _mtx.unlock();
    }
private:
    Mutex _mtx;
};